Imports System.Data.SqlClient


Namespace DbConnection
    <GlobalAvalibleObject()>
    Public Interface IConnection
        ''' <summary>
        ''' Executes a query with failover against the database with a number of parameters.
        ''' </summary>
        ''' <param name="query">SQL query to execute</param>
        ''' <param name="parameters">SQL Parameteres required.</param>
        ''' <returns>Query result datatable</returns>
        Function executeQuery(ByVal query As String, ByVal ParamArray parameters() As SqlParameter) As DataTable


        ''' <summary>
        ''' Executes a non-query with failover against the database with a number of parameters.
        ''' </summary>
        ''' <param name="query">SQL to execute</param>
        ''' <param name="parameters">SQL Parameteres required.</param>
        ''' <returns>Number of rows affected by the query.</returns>
        Function executeNonQuery(ByVal query As String, ByVal ParamArray parameters() As SqlParameter) As Integer

        ''' <summary>
        ''' Executes a scalar query with failover against the database with a number of parameters.
        ''' </summary>
        ''' <param name="query">Scalar SQL query to execute</param>
        ''' <param name="parameters">SQL Parameteres required.</param>
        ''' <returns>Scalar query result</returns>
        Function executeScalar(ByVal query As String, ByVal ParamArray parameters() As SqlParameter) As Object

        Sub close()

        ''' <summary>
        ''' Executes a file script 
        ''' </summary>
        ''' <param name="filePath">file path to execute it's script</param>
        ''' <returns>Number of rows affected by the script</returns>
        Function executeFileScript(ByVal filePath As String) As Integer

    End Interface

End Namespace

